package Q1;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String num = scanner.next();

        int len = num.length();

        int count = len % 3 == 0 ? len / 3 - 1 : len / 3; // 要添加的逗号的个数

        char[] ch = new char[len + count];

        int index = len - 1;
        int count1 = 0;
        for (int i = len + count - 1; i >= 0; i--) {
            ch[i] = num.charAt(index);
            if (i - 1 >= 0 && count1 % 3 == 2) {
                ch[--i] = ',';
            }
            count1++;
            index--;
        }

        String ret = new String(ch);

        System.out.println(ret);
    }
}
